//
//  PopularityVC.m
//  BrushFace
//
//  Created by timer_q on 16/1/19.
//  Copyright © 2016年 Zzz. All rights reserved.
//

#import "PopularityVC.h"
#import "PopularDetailVC.h"

@interface PopularityVC ()

@end

@implementation PopularityVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
    [self.navBar setTitle:@"我的人气"];
    [self.navBar setLeftBtn:NAV_BAR_LEFT_BTN_TYPE_BLUE];
    [self.navBar setNavBackColor:[UIColor whiteColor]];
    
    
    NSString *requestStr = [NSString stringWithFormat:@"%@/user/getpopularotyinfo4app.json",SERVICE_ADRESS];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager GET:requestStr parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {
        NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:operation.responseData options:0 error:nil];
        _popularLabel.text = [NSString stringWithFormat:@"%@",jsonDict[@"amount"]];
    } failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)buttonClick:(id)sender {
    PopularDetailVC *ppvc = [[PopularDetailVC alloc] init];
    [ppvc setHidesBottomBarWhenPushed:YES];
    [self.navigationController pushViewController:ppvc animated:YES];
    
}

@end
